package StudyGroup;/*
* 运算符学习
* 2022.1.8
* Creat By Code J
* */
/*public class operator {
    public static void main(String[] args){

        int num1 = 12;
        int num2 = 5;
        int result = num1 / num2;
        System.out.println(result);

        int result2 = (num1 / num2 *num2);
        System.out. println(result2);

        double result3 = num1 / num2;
        System.out.println(result3);

        double result4 = num1 / (num2 + 0.0);
        System.out.println(result4);

        double result5 = (double) num1 / num2;
        System.out.println(result5);

        double result6 = (double)(num1 / num2);
        System.out.println(result6);

        //结果的符号和被模数相同
        //开发中经常用取模符号判断是否能被除尽
        int m1 = 12;
        int n1 = 5;
        System.out.println("m1 % n1 = " + m1 % n1);

        int m2 = 12;
        int n2 = ++m2;
        System.out.println("m2 = " + m2 + "\t" + "n2 = " + n2 );

        int m3 = 12;
        int n3 = m3++;
        System.out.println("m3 = " + m3 +"\t"+ "n3 = " + n3);

    }
}*/

/*
public class operator {

    public static void main(String[] args){
        int i1 = 10;
        int i2 = 20;
        int i = i1++;

        System.out.println("i  = "+ i);//10
        System.out.println("i1 = " + i1);//11
        i = ++i1;
        System.out.println("i  = "+ i);//12
        System.out.println("i1 = " + i1);//12
        i = i2--;
        System.out.println("i  = "+ i);//20
        System.out.println("i2 = " + i2);//19
        i = --i2;
        System.out.println("i  = "+ i);//18
        System.out.println("i2 = " + i2);//18
    }
}
*/

/*
* 赋值运算符
* 2022.1.10
* */
public class operator{
    public static void main(String[] args) {

        int num1 = 10;
        int num2 = 10;

        num1 += 2;
        System.out.println(num1);

        short s1 = 10;
        s1 += 2;
        System.out.println(s1);

        int m = 2;
        int n = 3;
        n *= m++;
        System.out.println(m);//3
        System.out.println(n);//6
    }
}
